@extends('admin.base')
    @section('content')
        <!-- Content Header (Page header) -->
        <section class="content-header">
          <h1>
            商品信息展示表
            <small>preview of simple tables</small>
          </h1>
          <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> 首页</a></li>
            <li><a href="#">商品信息</a></li>
            <li class="active">列表</li>
          </ol>
        </section>



<script type="text/javascript" charset="utf-8" 

src="{{asset('/editdd/ueditor.config.js')}}"></script>
    <script type="text/javascript" charset="utf-8" src="{{asset('/editdd/ueditor.all.min.js')}}"> 

</script>
  
    <script type="text/javascript" charset="utf-8" src="{{asset('/editdd/lang/zh-cn/zh-

cn.js')}}"></script>





        <!-- Main content -->
        <section class="content">
          <div class="row">
            <div class="col-md-12">
              <div class="box">
                <div class="box-header with-border">
                  <h3 class="box-title"><i class="fa fa-th"></i>商品详情管理</h3>
                </div><!-- /.box-header -->
                <div class="box-body">
                  <table class="table table-bordered">
                  <from action="" >
                  <span style="font-size:50px;">ID-{{$list->id}}</span><sub style="color:red">的商品详情</sub>
                  
        <script id="editor" type="text/plain" style="width:1024px;height:500px;"   name="gooddetail">{!! $list->gooddetail !!}</script>
  

        <script type="text/javascript">

  
        var ue = UE.getEditor('editor');
        </script>
                 </from>  
                  </table>
                </div><!-- /.box-body -->
                <div class="box-footer clearfix">
                 
                </div>
              </div><!-- /.box -->
              
            </div><!-- /.col -->
            
          </div><!-- /.row -->
           
        </section><!-- /.content -->
        <form action="" style="display:none;" id="mydeleteform" method="post">
            <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">
            <input type="hidden" name="_method" value="DELETE">
        </form>

    @endsection
    
   

    @section("myscript")
      <script type="text/javascript">
            function doDel(id){
                if(confirm('确定要删除吗？')){
                    $("#mydeleteform").attr("action","{{url('admin/goodsDetail/')}}/"+id).submit(); 
                }
            }
      </script>
      <script type="text/javascript">
          $('input').blur(function(){
              
              //获取id
              var id = this.getAttributeNode('biaoji').value;

              //获取修改的值
              var val = this.value;

              //获取值的名字
              var name = this.getAttributeNode('name').value;

              $.ajax({
                url:"{{URL('admin/goodsDetail/')}}/"+id,
                type:"GET",
                data:{"id":id,"value":val,"name":name},
                dataType:"text",
                async:true,
                success:function(data){
                  return this;
                }
              });
          });
      </script>
      <form action="{{url('admin/doup')}}" method="post" enctype="multipart/form-data" style="display:none" id="myUpForm">
          <input type="file" name="myfile" id="myupup">
          <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">
      </form>
      <!-- <input type="file" name="xx" id="xx" style="display:none" />
      <input type="button" id="btn" onclick="document.getElementById('xx').click();" /> -->
      <script type="text/javascript">
        function doUp(ob){

          //获取id
          var id = ob.getAttributeNode('biaoji').value;

          //获取biaoji
          var bj = ob.getAttributeNode('xixi').value;

          var uurrll = document.getElementById('myUpForm').action = "{{URL('admin/doup')}}?id="+id+"&bj="+bj;


          // $.ajax({
          //    url:uurrll,
          //    type:"POST",
          //    data:$('#myUpForm').serialize(),
          //    dataType:"text",
          //    async:true,
          //    success:function(data){
          //       alert(data);
          //    }
          // });
          
          var imgID = document.getElementById('myImg'+id+"@"+bj);
          // document.getElementById('myUpForm').submit();

          // document.getElementById('myUpForm').submit();
          var formData = new FormData($( "#myUpForm" )[0]);  
               $.ajax({  
                    url: uurrll ,  
                    type: 'POST',  
                    data: formData,  
                    async: true,  
                    cache: false,  
                    contentType: false,  
                    processData: false,  
                    success: function (returndata) {  
                        var address = "{{URL('uploads/admin')}}/"+returndata;
                        imgID.setAttribute('src',address);
                         
                    },  
                    error: function (returndata) {  
                        alert(returndata);  
                    }  
               });  

        }
      </script>
    @endsection